package main

import "fmt"

func main() {
	fmt.Println("这里是slice的主题")
	/**
	参考文档：https://www.cnblogs.com/f-ck-need-u/p/9854932.html

	*/

	//my_slice :=make([]int,0,5)
	//my_slice = append(my_slice,1)
	//my_slice = append(my_slice,2)
	//my_slice = append(my_slice,3)
	//my_slice = append(my_slice,4)
	//my_slice = append(my_slice,5)
	//my_slice = append(my_slice,6)
	//my_slice = append(my_slice,7)
	//fmt.Println(my_slice)
	//
	//fmt.Println("nil切片的操作")
	//var empty_s []int
	//fmt.Printf("empty_s的长度%d\n",len(empty_s))
	//empty_s = append(empty_s,1)
	//fmt.Println(empty_s)

	fmt.Println("---------append------------")
	my_slice2 := []int{11, 22, 33, 44, 55}
	new_slice := my_slice2[1:3]

	// append()追加一个元素2323，返回新的slice
	app_slice2 := append(new_slice, 2323)

	fmt.Println(my_slice2)
	fmt.Println(new_slice)
	fmt.Println(app_slice2)
}
